<?php

function getCategory($catData, $prentsID = 0) {
    $catList = "<ul>";
    foreach ($catData as $aCat) {
        if ($aCat['category_parent'] == $prentsID) {
            $catList .= "<li><a href=/productList/".$aCat['category_id']."/".$aCat['category_name_filter'].'.html'.">" . $aCat['category_name'] . "</a></li>";
            $catList .= getCategory($catData, $aCat['category_id']);
        }
    }
    $catList .= "</ul>";
    return $catList;
}

$strProductCategory = getCategory($aryProductCategory);

echo $strProductCategory;

?>